/*
 * Copyright 2021 ThoughtWorks, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import m from "mithril";
import {AuthorizationExtensionType} from "models/shared/plugin_infos_new/extension_type";
import {NoPluginsOfTypeInstalled} from "views/components/no_plugins_installed/index";
import {TestHelper} from "views/pages/spec/test_helper";

describe("NoPluginsOfTypeInstalled", () => {
  const helper = new TestHelper();
  afterEach(() => {
    helper.unmount();
  });

  it("should render message", () => {
    helper.mount(() => <NoPluginsOfTypeInstalled extensionType={new AuthorizationExtensionType()}/>);

    expect(helper.root).toContainText('you must ensure that there are one or more');
    expect(helper.root).toContainText('Please see this page for a list of supported plugins.');
    expect(helper.q("a")).toContainText("this page");
  });
});
